package com.xjrsoft.module.test;

import com.xjrsoft.module.organization.entity.User;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
@Slf4j
public class MyRabbitMQProvide {

    private AmqpTemplate amqpTemplate;

    /**
     * 调用mq
     */
    public void testProvider() {
        log.info("调用mq");
        User user = new User();
        user.setName("测试mq");
        user.setCode("测试mq");
        amqpTemplate.convertAndSend("test", user);
    }
}
